package main

import (
	"flag"
	"fmt"
	"os"

	"gitee.com/minph/serve/app"
)

func main() {
	var dir, port string

	pwd, err := os.Getwd()

	if err != nil {
		fmt.Println(err)
		return
	}

	flag.StringVar(&dir, "dir", pwd, "the path of the dir")
	flag.StringVar(&port, "port", "5050", "the port of the serve")

	app.Run(dir, port, func(dir, port string) {
		fmt.Printf("The static dir is in %v/\n", dir)
		fmt.Printf("The static serve is running at http://localhost:%v/\n", port)
	})
}
